d4ec47bfb3d012be42a327858a07ad5584114cce,java/sigProc/ERSPClassifier.java,ERSPClassifier,preproc,#Matrix#,37
Before Change
@Override
public Matrix preproc(Matrix data){
// Common pre-processing
super.preproc(data);
// Welch frequency estimation
System.out.println( "Spectral transformation with welch method");
// TODO: Make welch more intelligent....
data = data.welch(1, welchWindow, welchAveType, null, 0);
System.out.println( "Data shape after welch frequency estimation: " + data.shapeString());
// Selecting frequencies
if (windowFrequencyIdx != null) {
int[] allRows = Matrix.range(0, data.getRowDimension(), 1);
data = new Matrix(data.getSubMatrix(allRows, windowFrequencyIdx));
System.out.println( "Data shape after frequency selection: " + data.shapeString());
}
return data;
}
After Change
@Override
public Matrix preproc(Matrix data){
// Common pre-processing
data = super.preproc(data);
// Welch frequency estimation
if ( VERB>1 ) System.out.println(TAG+ "Data shape after preproc: " + data.shapeString());
if ( VERB>1 ) System.out.println( "Spectral transformation with welch method");
// TODO: Make welch more intelligent....
data = data.welch(1, welchWindow, welchAveType, null, 0);
if ( VERB>1 ) System.out.println(TAG+ "New size: " + data.shapeString());
// Selecting frequencies
if (windowFrequencyIdx != null) {
if ( VERB>1 ) System.out.println(TAG+"Frequency selection");
int[] allRows = Matrix.range(0, data.getRowDimension(), 1);
data = new Matrix(data.getSubMatrix(allRows, windowFrequencyIdx));
if ( VERB>1 ) System.out.println(TAG+ "New size: " + data.shapeString());
}
return data;
}